# -*- coding: utf-8 -*-



import  wx
import  os
import sys

#import logtextctrl as logtc


from UI import constants


class ColoredPanel(wx.Window):
    def __init__(self, parent):
        wx.Window.__init__(self, parent, -1, style = wx.SIMPLE_BORDER)
        #self.SetBackgroundColour(color)

class MsgPanel(wx.Notebook):
    def __init__(self,parent, size =(21,21) ):
        wx.Notebook.__init__(self, parent, -1, size=size,
                         #style=
                         #wx.NB_TOP # | wx.NB_MULTILINE
                         #wx.NB_BOTTOM
                         #wx.NB_LEFT
                         #wx.NB_RIGHT
                         )
        #self.log = logtc.LogTextCtrl()

        win = self.makeColorPanel()
        """
        cons = constants.Constants()
        
        self.multiText = wx.TextCtrl(win, cons.LOG_TEXTCTRL,
               u"程序启动\n",
               size=(400, 200), style=wx.TE_MULTILINE)
        
        self.multiText.SetInsertionPoint(1)
        """
        self.AddPage(win, u"日志")        
        win2 = self.makeColorPanel()
        self.AddPage(win2, u"当前指令")
        
        
    def makeColorPanel(self):
        p = wx.Panel(self, -1)
        win = ColoredPanel(p)
        p.win = win        
    
        def OnCPSize(evt):
            win.SetSize(evt.GetSize())
        
        
        p.Bind(wx.EVT_SIZE, OnCPSize)
        return p
    
  #
